]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st/theme-node: Only try to parse non-empty inline styles
authorSebastian Keller <skeller@gnome.org>
Fri, 29 Apr 2022 21:30:21 +0000 (23:30 +0200)
committerMarge Bot <marge-bot@gnome.org>
Fri, 29 Apr 2022 21:50:55 +0000 (21:50 +0000)
Otherwise cr_parser_new_from_buf() will fail creating a parser for a
buffer of length 0, resulting in further errors due to the parser being
NULL. This could happen when extensions were trying to set the style of
a widget to an empty string.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4634
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2286>

src/st/st-theme-node.c

index 13dbca88fdb2345e9dbbb14c9ac093355d1b1854..6e09c3939a33f0d7d8857290232dbebd7a88da00 100644 (file)
@@ -456,7 +456,7 @@ ensure_properties (StThemeNode *node)
       if (node->theme)
         properties = _st_theme_get_matched_properties (node->theme, node);
 
-      if (node->inline_style)
+      if (node->inline_style && *node->inline_style != '\0')
         {
           CRDeclaration *cur_decl;